package dayOOP0718;

import java.util.Scanner;

public class UserServiceImpl {

    public void login(){
        Scanner s=new Scanner(System.in);
        System.out.println("请输入用户名:");
        String username=s.next();
        System.out.println("请输入密码:");
        String pwd=s.next();
        if("zhangSan".equals(username) &&   "a1q23".equals(pwd)){
            System.out.println("进入系统首页");
        }else{//抛出异常
            throw  new UserNameOrPassWrongException("用户名或密码错误");
        }
    }

}
